#ifndef DOUBAN_DATA_DOUMAILMODEL_H
#define DOUBAN_DATA_DOUMAILMODEL_H
#include "douban_global.h"
#include <QAbstractItemModel>
namespace Douban
{
	class DoumailModel:public QAbstractItemModel
	{

		public:
			const Doumail* getMail(const QModelIndex& index) const;
			void updateLayout() { emit layoutChanged(); }



			int columnCount(const QModelIndex&)		const { return 2; }
			int rowCount(const QModelIndex &)		const { return m_inbox.size(); }
			QModelIndex parent(const QModelIndex&)	const { return QModelIndex(); }
			QModelIndex index(int r,int c,const QModelIndex& = QModelIndex()) const { return createIndex(r,c); }

			QVariant data(const QModelIndex&, int)	const;
			QVariant headerData(int, Qt::Orientation, int = Qt::DisplayRole) const;
			DoumailModel(const Doumails& m):QAbstractItemModel(0),m_inbox(m){}
		private:
			const Doumails&		m_inbox;
			Q_DISABLE_COPY(DoumailModel)
	};
}

#endif /* DOUMAILMODEL_H_ */
